import json

def check_bboxes(coco_file):
    with open(coco_file, 'r', encoding='utf-8') as f:
        coco_data = json.load(f)

    annotations = coco_data['annotations']
    for annotation in annotations:
        bbox = annotation['bbox']
        x_min, y_min, width, height = bbox
        x_max = x_min + width
        y_max = y_min + height
        if x_max <= x_min or y_max <= y_min:
            print(f"Invalid bbox: {bbox}")

# 示例用法
coco_file = 'Meishan/annotation/val_coco.json'
check_bboxes(coco_file)